package com.gopay.common.domain.acps;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * 账务核心处理中心 账务交易明细表
 * 
 * @AcpsAcctTransDtl.java
 * @author zhanglei
 * @2012-12-28 上午11:37:33 www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name = "ACPS_ACCT_TRANS_DTL")
public class AcpsAcctTransDtl implements Serializable {
    private static final long serialVersionUID = -1971440252956093202L;
    /** 允许金额最小值. */
    public static final BigDecimal MIN_TRANAMT = new BigDecimal("0");
    /** 允许金额最大值. */
    public static final BigDecimal MAX_TRANAMT = new BigDecimal("9999999999.9999");
    /** 指定生成tranId的oracle的SEQUENCE **/
    public static final String SEQUENCE_TRAN_ID = "ACPS_TRAN_ID_SEQ";
    /** 指定生成tranSq的oracle的SEQUENCE **/
    public static final String SEQUENCE_TRAN_SQ = "ACPS_TRAN_SQ_SEQ";
    /** 默认情况下tranId的前缀为S **/
    public static final String PREFIX_SYSTEM = "S";
    /** 手工调账时tranId的前缀为M **/
    public static final String PREFIX_MANUAL = "M";
    /** tranId的数字长度为8位 **/
    public static final int LENGTH = 8;

    private long acctTransDtlSq;
    private String gopayOrderId;
    private String acctId;
    private String custId;
    private Drcr drCr;
    private String tranId;
    private String partTranSrlNum;
    private Date tranTime;
    private TranType tranType;
    private CurrencyCode curType;
    private BigDecimal tranAmt;
    private BigDecimal curBalAfterTrans;
    private BigDecimal curBalBeforeTrans;
    private int delFlg;
    private Date valueDate;
    private String tranParticular;
    private String tranRmks;
    private PstdFlag pstdFlg;
    private String lchgUserId;
    private Date lastUpdTm;
    private String rcreUserId;
    private Date rcreTime;
    private String dtlPackageId;



    private BigDecimal curAvaAfterTrans;
    private BigDecimal curAvaBeforeTrans;
    private BigDecimal frezAmt;


    @Id
    @Column(name = "ACCT_TRANS_DTL_SQ", unique = true, nullable = false, precision = 22, scale = 0)
    public Long getAcctTransDtlSq() {
        return this.acctTransDtlSq;
    }

    public void setAcctTransDtlSq(Long acctTransDtlSq) {
        this.acctTransDtlSq = acctTransDtlSq;
    }

    @Column(name = "GOPAY_ORDER_ID", nullable = false, length = 30)
    public String getGopayOrderId() {
        return this.gopayOrderId;
    }

    public void setGopayOrderId(String gopayOrderId) {
        this.gopayOrderId = gopayOrderId;
    }

    @Column(name = "ACCT_ID", nullable = false, length = 19)
    public String getAcctId() {
        return this.acctId;
    }

    public void setAcctId(String acctId) {
        this.acctId = acctId;
    }

    @Column(name = "CUST_ID", nullable = false, length = 10)
    public String getCustId() {
        return this.custId;
    }

    public void setCustId(String custId) {
        this.custId = custId;
    }

    @Column(name = "DR_CR", nullable = false, length = 1)
    @Enumerated(EnumType.STRING)
    public Drcr getDrCr() {
        return this.drCr;
    }

    public void setDrCr(Drcr drCr) {
        this.drCr = drCr;
    }

    @Column(name = "TRAN_ID")
    public String getTranId() {
        return this.tranId;
    }

    public void setTranId(String tranId) {
        this.tranId = tranId;
    }

    @Column(name = "PART_TRAN_SRL_NUM", nullable = false, length = 4)
    public String getPartTranSrlNum() {
        return this.partTranSrlNum;
    }

    public void setPartTranSrlNum(String partTranSrlNum) {
        this.partTranSrlNum = partTranSrlNum;
    }

    @Column(name = "TRAN_TIME", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getTranTime() {
        return this.tranTime;
    }

    public void setTranTime(Date tranTime) {
        this.tranTime = tranTime;
    }

    @Column(name = "TRAN_TYPE", nullable = false, length = 1)
    @Enumerated(EnumType.STRING)
    public TranType getTranType() {
        return this.tranType;
    }

    public void setTranType(TranType tranType) {
        this.tranType = tranType;
    }

    @Column(name = "CUR_TYPE", nullable = false, length = 3)
    @Enumerated(EnumType.STRING)
    public CurrencyCode getCurType() {
        return this.curType;
    }

    public void setCurType(CurrencyCode curType) {
        this.curType = curType;
    }

    @Column(name = "TRAN_AMT", nullable = false, precision = 25, scale = 4)
    public BigDecimal getTranAmt() {
        return this.tranAmt;
    }

    public void setTranAmt(BigDecimal tranAmt) {
        this.tranAmt = tranAmt;
    }

    @Column(name = "CUR_BAL_AFTER_TRANS", nullable = false, precision = 25, scale = 4)
    public BigDecimal getCurBalAfterTrans() {
        return this.curBalAfterTrans;
    }

    public void setCurBalAfterTrans(BigDecimal curBalAfterTrans) {
        this.curBalAfterTrans = curBalAfterTrans;
    }

    @Column(name = "CUR_BAL_BEFORE_TRANS", nullable = false, precision = 25, scale = 4)
    public BigDecimal getCurBalBeforeTrans() {
        return this.curBalBeforeTrans;
    }

    public void setCurBalBeforeTrans(BigDecimal curBalBeforeTrans) {
        this.curBalBeforeTrans = curBalBeforeTrans;
    }

    @Column(name = "DEL_FLG", nullable = false, precision = 1, scale = 0)
    public int getDelFlg() {
        return this.delFlg;
    }

    public void setDelFlg(int delFlg) {
        this.delFlg = delFlg;
    }

    @Column(name = "VALUE_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getValueDate() {
        return this.valueDate;
    }

    public void setValueDate(Date valueDate) {
        this.valueDate = valueDate;
    }

    @Column(name = "TRAN_PARTICULAR", length = 30)
    public String getTranParticular() {
        return this.tranParticular;
    }

    public void setTranParticular(String tranParticular) {
        this.tranParticular = tranParticular;
    }

    @Column(name = "TRAN_RMKS", length = 50)
    public String getTranRmks() {
        return this.tranRmks;
    }

    public void setTranRmks(String tranRmks) {
        this.tranRmks = tranRmks;
    }

    @Column(name = "PSTD_FLG", nullable = false, length = 1)
    @Enumerated(EnumType.STRING)
    public PstdFlag getPstdFlg() {
        return this.pstdFlg;
    }

    public void setPstdFlg(PstdFlag pstdFlg) {
        this.pstdFlg = pstdFlg;
    }

    @Column(name = "LCHG_USER_ID", length = 10)
    public String getLchgUserId() {
        return this.lchgUserId;
    }

    public void setLchgUserId(String lchgUserId) {
        this.lchgUserId = lchgUserId;
    }

    @Column(name = "LAST_UPD_TM", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastUpdTm() {
        return this.lastUpdTm;
    }

    public void setLastUpdTm(Date lastUpdTm) {
        this.lastUpdTm = lastUpdTm;
    }

    @Column(name = "RCRE_USER_ID", length = 10)
    public String getRcreUserId() {
        return this.rcreUserId;
    }

    public void setRcreUserId(String rcreUserId) {
        this.rcreUserId = rcreUserId;
    }

    @Column(name = "RCRE_TIME", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getRcreTime() {
        return this.rcreTime;
    }

    public void setRcreTime(Date rcreTime) {
        this.rcreTime = rcreTime;
    }

    @Column(name = "DTL_PACKAGE_ID", length = 32)
    public String getDtlPackageId() {
        return dtlPackageId;
    }

    public void setDtlPackageId(String dtlPackageId) {
        this.dtlPackageId = dtlPackageId;
    }

    @Column(name = "CUR_AVA_AFTER_TRANS", precision = 25, scale = 4)
    public BigDecimal getCurAvaAfterTrans() {
        return curAvaAfterTrans;
    }

    public void setCurAvaAfterTrans(BigDecimal curAvaAfterTrans) {
        this.curAvaAfterTrans = curAvaAfterTrans;
    }

    @Column(name = "CUR_AVA_BEFORE_TRANS", precision = 25, scale = 4)
    public BigDecimal getCurAvaBeforeTrans() {
        return curAvaBeforeTrans;
    }

    public void setCurAvaBeforeTrans(BigDecimal curAvaBeforeTrans) {
        this.curAvaBeforeTrans = curAvaBeforeTrans;
    }

    @Column(name = "FREZ_AMT", precision = 25, scale = 4)
    public BigDecimal getFrezAmt() {
        return frezAmt;
    }

    public void setFrezAmt(BigDecimal frezAmt) {
        this.frezAmt = frezAmt;
    }
}
